package Launcher;

import gossipServices.gossipMessages.GeneralGossipMessage;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import networkRmi.CommunicationHandler;
import networkRmi.CommunicationServer;

import messages.Message;

public class NodeClient {
	public static void main(String[] args){
		CommunicationHandler com = new CommunicationHandler("NodeClient");
		CommunicationServer comServer = com.getComServer();
		
		while(true){
			try {
				Thread.sleep(3000);
				Message m = new GeneralGossipMessage();				
				comServer.sendMessage(m, InetAddress.getLocalHost(), "NodeServer");
			} catch (RemoteException e) {
				e.printStackTrace();
			} catch (UnknownHostException e) {
				e.printStackTrace();
			} catch (InterruptedException e) {
				e.printStackTrace();
			} catch (NotBoundException e) {
				e.printStackTrace();
			}
		}
	}
}
